package com.elepant.dp.cor;

public class UrlFilter implements Filter{
    @Override
    public void doFilter(Request request, Response response,FilterChain filterChain) {
        request.hearder = request.hearder.replace("baidu.com","http://www.baidu.com");
        System.out.println("开始处理Url request："+request.hearder);

        //处理完request 后转交给下个filter继续处理
        filterChain.doFilter(request,response);

        response.hearder = "Url response processed!";
        System.out.println("开始处理Url response："+response.hearder);
    }
}
